/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-01-12 09:35:49
 * @LastEditTime : 2023-05-25 14:21:48
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Modal\TwoModalList\BeamProduceRecordPersonGroup.jsx
 * @Description  :
 */

import { API_LIST } from '../../../Api/Api'
import { DelDataButton, OpenThrTouter } from '../Common/options'

export const BeamProduceRecordPersonGroup = async ({ OptionsEvent, oneData, Permission, actionRef, ClientData }) => {
    let dataList = {
        hideInSearch: true,
        pageSize: 10,
        params: { beamProduceRecordUuid: oneData.uuid },
        get: API_LIST()['getBeamProduceRecordPersonGroup'],
        options: [
            Permission.findIndex(v => v.uuid === '9726de59-d3d7-428b-886d-40bac7b023e2') !== -1 && (
                <OpenThrTouter
                    title="新增人员分组"
                    type="primary"
                    icon="add"
                    modal="SelectModal"
                    OptionsEvent={OptionsEvent}
                    other={{
                        page: 'BeamProduceRecordPersonGroup',
                        actionRef,
                        Permission,
                        twoData: oneData,
                    }}
                />
            ),
        ],
        columns: [
            {
                title: '分组名称',
                dataIndex: 'personGroupName',
                search: false,
            },
            {
                title: '人员姓名',
                dataIndex: 'tableName',
                search: false,
                valueType: 'input',
            },
            {
                title: '手机号码',
                dataIndex: 'mobile',
                search: false,
                valueType: 'input',
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 300,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        Permission.findIndex(v => v.uuid === 'a0873210-909f-4cdb-a258-8ead2e945afb') !== -1 && (
                            <DelDataButton
                                OptionsEvent={OptionsEvent}
                                key="del"
                                title="删除"
                                url="BeamProduceRecordPersonGroup"
                                uuid={record.beamProduceRecordPersonGroupUuid}
                            />
                        ),
                    ]
                },
            },
        ],
    }

    return dataList
}
